import React from 'react';
import ReactDOM from 'react-dom';
import NewsListFunc from './components/NewsListFunc';
import NewsListClass from './components/NewsListClass'
let list = []



async function fetchGetList(){
  ReactDOM.render(

   "...正在加载中"
    
    , document.getElementById('root'));
  const res = await fetch("https://demo-api.apipost.cn/api/demo/news_list?mobile=18289454846&theme_news=国际新闻&page=1&pageSize=20").then(resp=>resp.json()).then(res=>res.data)
  console.log(res)
  list = res.lists
  console.log(list)
  setTimeout(() => {
    render()
  }, 2000);

  
}
fetchGetList()
console.log(list)
function render(){
  ReactDOM.render(

    <NewsListClass list={list}/>
    
    , document.getElementById('root'));
}
